<div id="content-outer">
  <div id="content">
    <div id="page-heading"><h1>Add over time</h1></div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <?php //echo $this->Html->image('../images/shared/side_shadowleft.jpg', array('alt' => '', 'width' => '20', 'height' => '300')); ?>
            </th>
            <th class="topleft"></th>
            <td id="tbl-border-top">&nbsp;</td>
            <th class="topright"></th>
            <th rowspan="3" class="sized">
                <?php //echo $this->Html->image('../images/shared/side_shadowright.jpg', array('alt' => '', 'width' => '20', 'height' => '300')); ?>
             </th>
        </tr>
        <tr>
            <td id="tbl-border-left"></td>
            <td>
                <div id="content-table-inner">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0">
                        <tr valign="top">
                            <td>
                                <?php echo $this->Form->create("CashierOvertime", array('url' => array('controller'=>'cashiers','action'=>'add_overtime'), 'class' => 'form', 'type' => 'file')); ?>
                                <table border="0" cellpadding="0" cellspacing="0"  id="id-form">
                                    <?php echo $this->Session->flash();?>
                                    <tr>
                                        <th valign="top">Overtime Date</th>
                                        <td>
                                            <?php
                                                echo $this->Form->input('CashierOvertime.day', array(
                                                                    'label'     => false,
                                                                    'div'       => false,
                                                                    'id'        =>'day',
                                                                    'type'      =>'text',
                                                                    'class'     => 'inp-form med')
                                                );     
                                            ?>      
                                        </td>
                                        <td></td> 
                                    </tr>
                                    <tr>
                                        <th valign="top">Working Time</th>
                                        <td>
                                            <script type="text/javascript">
                                                $(document).ready(function(data){
                                                    $('#time_start, #time_end').calendricalTimeRange({
                                                            'isoTime':"ios"
                                                        }
                                                    );
                                                    var dates = $( "#day" ).datepicker({
                                                        dateFormat: "yy-mm-dd",
                                                        showOn: "button",
                                                        maxDate:new Date(),
                                                        buttonImage: "<?php echo $this->webroot; ?>images/forms/icon_calendar.jpg",
                                                        buttonImageOnly: true
                                                        /*onSelect: function( selectedDate ) {
                                                            date_select = new Date($("#OnsiteSesionStartDate").datepicker('getDate'));
                                                            day= date_select.getUTCDay();   
                                                            day_of_week = myDays[day];
                                                            var option = this.id == "OnsiteSesionStartDate" ? "minDate" : "maxDate",
                                                                    instance = $( this ).data( "datepicker" ),
                                                                    date = $.datepicker.parseDate(
                                                                            instance.settings.dateFormat ||
                                                                            $.datepicker._defaults.dateFormat,
                                                                            selectedDate, instance.settings );
                                                            dates.not( this ).datepicker( "option", option, date );
                                                            if(this.id=='OnsiteSesionEndDate'){
                                                                start_date = new Date($("#OnsiteSesionStartDate").datepicker("getDate"));
                                                                end_date = new Date($("#OnsiteSesionEndDate").datepicker("getDate"));
                                                                DAY_MSECONDS = 1000 * 60 * 60 * 24; // m-seconds in a day
                                                                var d1_ms = end_date.getTime(); // date1 
                                                                var d2_ms = start_date.getTime(); // date2
                                                                var days = Math.ceil(Math.abs(d1_ms - d2_ms) / DAY_MSECONDS) + 1;
                                                                $('#OnsiteSesionDuration').val(days);
                                                                //calculate_price();
                                                            }
                                                        }*/
                                                    });
                                                });
                                            </script>
                                             <?php
                                                echo $this->Form->input('CashierOvertime.hour_from', array(
                                                                    'label'     => false,
                                                                    'div'       => false,
                                                                    'onkeypress'=>"return false",
                                                                    'id'        =>"time_start",
                                                                    'style'     =>"width:100px",
                                                                    'type'      =>'text',
                                                                    'class'     => 'input-form med')
                                                    );     
                                            ?>  -  <?php
                                                echo $this->Form->input('CashierOvertime.hour_to', array(
                                                                    'label'     => false,
                                                                    'div'       => false,
                                                                    'onkeypress'=>"return false",
                                                                    'id'        =>"time_end",
                                                                    'type'      =>'text',
                                                                    'style'     =>"width:100px",
                                                                    'class'     => 'input-form med')
                                                    );     
                                            ?>
                                        </td>
                                        <td></td> 
                                    </tr>
                                    
                                    <tr>
                                        <th>&nbsp;</th>
                                        <td valign="top">
                                            <?php echo $this->Form->submit('Submit', array('div'=>false,'label'=>false,'class' => 'submit-button')); ?>
                                            <?php echo $this->Html->link('Cancel', array('controller' => $lN, 'action' => 'index', 'admin' => false), array('class' => 'cancel-button')); ?>
                                        </td>
                                        <td></td>
                                    </tr>
                                </table>
                                <?php echo $this->Form->end();?>    
                            </td>
                            <td></td>
                        </tr>
                        <tr>
                            <td>
                               <?php echo $this->Html->image('../images/shared/blank.gif', array('alt' => 'blank', 'width' => '695', 'height' => '1')); ?>
                            </td>
                            <td></td>
                        </tr>
                    </table>
                    <div class="clear"></div>
                </div>
            </td>
            <td id="tbl-border-right"></td>
        </tr>
        <tr>
            <th class="sized bottomleft"></th>
            <td id="tbl-border-bottom">&nbsp;</td>
            <th class="sized bottomright"></th>
        </tr>
    </table>
    <div class="clear">&nbsp;</div>
  </div>
</div>